/**
 * Project: Useful Programs
 * Package: tools
 */
package org.leumasjaffe.io;

import java.io.PrintStream;
import java.util.Iterator;
import java.util.List;

/**
 * Class PortablePrinter in file PortablePrinter.java
 * 
 * @author leumasjaffe
 * Created on: Jul 26, 2012
 * 
 */
public class PortablePrinter {		
	/**
	 * 
	 */
	static PrintStream stdout;
	
	static {
		stdout = System.out;
	}
	
	/**
	 * @param o
	 */
	public static void print(Object o) {
		stdout.print(o);
	}
	
	/**
	 * @param i
	 */
	public static void print(int i) {
		stdout.print(i);
	}
	
	/**
	 * @param i
	 */
	public static void print(float i) {
		stdout.print(i);
	}
	
	/**
	 * @param i
	 */
	public static void print(double i) {
		stdout.print(i);
	}
	
	/**
	 * @param i
	 */
	public static void print(char i) {
		stdout.print(i);
	}
	
	/**
	 * @param i
	 */
	public static void print(boolean i) {
		stdout.print(i);
	}
	
	/**
	 * @param i
	 */
	public static void print(long i) {
		stdout.print(i);
	}
	
	/**
	 * @param o
	 */
	public static void println(Object o) {
		stdout.println(o);
	}
	
	/**
	 * @param i
	 */
	public static void println(int i) {
		stdout.println(i);
	}
	
	/**
	 * @param i
	 */
	public static void println(float i) {
		stdout.println(i);
	}
	
	/**
	 * @param i
	 */
	public static void println(double i) {
		stdout.println(i);
	}
	
	/**
	 * @param i
	 */
	public static void println(char i) {
		stdout.println(i);
	}
	
	/**
	 * @param i
	 */
	public static void println(boolean i) {
		stdout.println(i);
	}
	
	/**
	 * @param i
	 */
	public static void println(long i) {
		stdout.println(i);
	}
	
	/**
	 * @param data
	 */
	public static void print(Object... data) {
		for (Object o : data)
			stdout.print(o);
	}
	
	/**
	 * @param data
	 */
	public static void print(List<?> data) {
		Iterator<?> i = data.iterator();
		while (i.hasNext())
			print(i.next());
	}
	
	/**
	 * @param data
	 */
	public static void print(int... data) {
		for (int l : data)
			stdout.print(l);
	}
	
	/**
	 * @param data
	 */
	public static void print(float... data) {
		for (float l : data)
			stdout.print(l);
	}
	
	/**
	 * @param data
	 */
	public static void print(double... data) {
		for (double l : data)
			stdout.print(l);
	}
	
	/**
	 * @param data
	 */
	public static void print(char... data) {
		for (char l : data)
			stdout.print(l);
	}
	
	/**
	 * @param data
	 */
	public static void print(boolean... data) {
		for (boolean l : data)
			stdout.print(l);
	}
	
	/**
	 * @param data
	 */
	public static void print(long... data) {
		for (long l : data)
			stdout.print(l);
	}
	
	/**
	 * @param data
	 */
	public static void println(Object... data) {
		for (Object o : data)
			stdout.print(o);
		println();
	}
	
	/**
	 * @param data
	 */
	public static void println(List<?> data) {
		Iterator<?> i = data.iterator();
		while (i.hasNext())
			print(i.next());
		println();
	}
	
	/**
	 * @param data
	 */
	public static void printlist(List<?> data) {
		Iterator<?> i = data.iterator();
		int j = 0;
		while (i.hasNext()) {
			print('[');
			print(j++);
			print("] ");
			println(i.next());
		}
	}
	
	/**
	 * @param data
	 */
	public static void println(int... data) {
		for (int l : data)
			stdout.print(l);
		println();
	}
	
	/**
	 * @param data
	 */
	public static void println(float... data) {
		for (float l : data)
			stdout.print(l);
		println();
	}
	
	/**
	 * @param data
	 */
	public static void println(double... data) {
		for (double l : data)
			stdout.print(l);
		println();
	}
	
	/**
	 * @param data
	 */
	public static void println(char... data) {
		for (char l : data)
			stdout.print(l);
		println();
	}
	
	/**
	 * @param data
	 */
	public static void println(boolean... data) {
		for (boolean l : data)
			stdout.print(l);
		println();
	}
	
	/**
	 * @param data
	 */
	public static void println(long... data) {
		for (long l : data)
			stdout.print(l);
		println();		
	}
	
	/**
	 * @param div
	 * @param data
	 */
	public static void prints(String div, Object... data) {
		for (Object o : data) {
			stdout.print(o);
			print(div);
		}
	}
	
	/**
	 * @param div
	 * @param data
	 */
	public static void prints(String div, List<?> data) {
		Iterator<?> i = data.iterator();
		while (i.hasNext()) {
			print(i.next());
			print(div);
		}
	}
	
	/**
	 * @param div
	 * @param data
	 */
	public static void prints(String div, int... data) {
		for (int l : data) {
			stdout.print(l);
			print(div);
		}
	}
	
	/**
	 * @param div
	 * @param data
	 */
	public static void prints(String div, float... data) {
		for (float l : data) {
			stdout.print(l);
			print(div);
		}
	}
	
	/**
	 * @param div
	 * @param data
	 */
	public static void prints(String div, double... data) {
		for (double l : data) {
			stdout.print(l);
			print(div);
		}
	}
	
	/**
	 * @param div
	 * @param data
	 */
	public static void prints(String div, char... data) {
		for (char l : data) {
			stdout.print(l);
			print(div);
		}
	}
	
	/**
	 * @param div
	 * @param data
	 */
	public static void prints(String div, boolean... data) {
		for (boolean l : data) {
			stdout.print(l);
			print(div);
		}
	}
	
	/**
	 * @param div
	 * @param data
	 */
	public static void prints(String div, long... data) {
		for (long l : data) {
			stdout.print(l);
			print(div);
		}
	}
	
	/**
	 * 
	 */
	public static void println() {
		stdout.println();
	}
		
	/**
	 * @param out
	 * @param o
	 */
	public static void print(PrintStream out, Object o) {
		out.print(o);
	}
	
	/**
	 * @param out
	 * @param i
	 */
	public static void print(PrintStream out, int i) {
		out.print(i);
	}
	
	/**
	 * @param out
	 * @param i
	 */
	public static void print(PrintStream out, float i) {
		out.print(i);
	}
	
	/**
	 * @param out
	 * @param i
	 */
	public static void print(PrintStream out, double i) {
		out.print(i);
	}
	
	/**
	 * @param out
	 * @param i
	 */
	public static void print(PrintStream out, char i) {
		out.print(i);
	}
	
	/**
	 * @param out
	 * @param i
	 */
	public static void print(PrintStream out, boolean i) {
		out.print(i);
	}
	
	/**
	 * @param out
	 * @param i
	 */
	public static void print(PrintStream out, long i) {
		out.print(i);
	}
	
	/**
	 * @param out
	 * @param o
	 */
	public static void println(PrintStream out, Object o) {
		out.println(o);
	}
	
	/**
	 * @param out
	 * @param i
	 */
	public static void println(PrintStream out, int i) {
		out.println(i);
	}
	
	/**
	 * @param out
	 * @param i
	 */
	public static void println(PrintStream out, float i) {
		out.println(i);
	}
	
	/**
	 * @param out
	 * @param i
	 */
	public static void println(PrintStream out, double i) {
		out.println(i);
	}
	
	/**
	 * @param out
	 * @param i
	 */
	public static void println(PrintStream out, char i) {
		out.println(i);
	}
	
	/**
	 * @param out
	 * @param i
	 */
	public static void println(PrintStream out, boolean i) {
		out.println(i);
	}
	
	/**
	 * @param out
	 * @param i
	 */
	public static void println(PrintStream out, long i) {
		out.println(i);
	}
	
	/**
	 * @param out
	 * @param data
	 */
	public static void print(PrintStream out, Object... data) {
		for (Object o : data)
			print(out, o);
	}
	
	/**
	 * @param out
	 * @param data
	 */
	public static void print(PrintStream out, List<?> data) {
		Iterator<?> i = data.iterator();
		while (i.hasNext())
			print(out, i.next());
	}
	
	/**
	 * @param out
	 * @param data
	 */
	public static void print(PrintStream out, int... data) {
		for (int l : data)
			print(out, l);
	}
	
	/**
	 * @param out
	 * @param data
	 */
	public static void print(PrintStream out, float... data) {
		for (float l : data)
			out.print(l);
	}
	
	/**
	 * @param out
	 * @param data
	 */
	public static void print(PrintStream out, double... data) {
		for (double l : data)
			print(out, l);
	}
	
	/**
	 * @param out
	 * @param data
	 */
	public static void print(PrintStream out, char... data) {
		for (char l : data)
			print(out, l);
	}
	
	/**
	 * @param out
	 * @param data
	 */
	public static void print(PrintStream out, boolean... data) {
		for (boolean l : data)
			print(out, l);
	}
	
	/**
	 * @param out
	 * @param data
	 */
	public static void print(PrintStream out, long... data) {
		for (long l : data)
			print(out, l);
	}
	
	/**
	 * @param out
	 * @param data
	 */
	public static void println(PrintStream out, Object... data) {
		for (Object o : data)
			print(out, o);
		println(out);
	}
	
	/**
	 * @param out
	 * @param data
	 */
	public static void println(PrintStream out, List<?> data) {
		Iterator<?> i = data.iterator();
		while (i.hasNext())
			print(out, i.next());
		println(out);
	}
	
	/**
	 * @param out
	 * @param data
	 */
	public static void printlist(PrintStream out, List<?> data) {
		Iterator<?> i = data.iterator();
		int j = 0;
		while (i.hasNext()) {
			print(out, '[');
			print(out, j++);
			print(out, "] ");
			println(out, i.next());
		}
	}
	
	/**
	 * @param out
	 * @param data
	 */
	public static void println(PrintStream out, int... data) {
		for (int l : data)
			print(out, l);
		println(out);
	}
	
	/**
	 * @param out
	 * @param data
	 */
	public static void println(PrintStream out, float... data) {
		for (float l : data)
			print(out, l);
		println(out);
	}
	
	/**
	 * @param out
	 * @param data
	 */
	public static void println(PrintStream out, double... data) {
		for (double l : data)
			print(out, l);
		println(out);
	}
	
	/**
	 * @param out
	 * @param data
	 */
	public static void println(PrintStream out, char... data) {
		for (char l : data)
			print(out, l);
		println(out);
	}
	
	/**
	 * @param out
	 * @param data
	 */
	public static void println(PrintStream out, boolean... data) {
		for (boolean l : data)
			print(out, l);
		println(out);
	}
	
	/**
	 * @param out
	 * @param data
	 */
	public static void println(PrintStream out, long... data) {
		for (long l : data)
			print(out, l);
		println(out);		
	}
	
	/**
	 * @param out
	 * @param div
	 * @param data
	 */
	public static void prints(PrintStream out, String div, Object... data) {
		for (Object o : data) {
			print(out, o);
			print(out, div);
		}
	}
	
	/**
	 * @param out
	 * @param div
	 * @param data
	 */
	public static void prints(PrintStream out, String div, List<?> data) {
		Iterator<?> i = data.iterator();
		while (i.hasNext()) {
			print(out, i.next());
			print(out, div);
		}
	}
	
	/**
	 * @param out
	 * @param div
	 * @param data
	 */
	public static void prints(PrintStream out, String div, int... data) {
		for (int l : data) {
			print(out, l);
			print(out, div);
		}
	}
	
	/**
	 * @param out
	 * @param div
	 * @param data
	 */
	public static void prints(PrintStream out, String div, float... data) {
		for (float l : data) {
			print(out, l);
			print(out, div);
		}
	}
	
	/**
	 * @param out
	 * @param div
	 * @param data
	 */
	public static void prints(PrintStream out, String div, double... data) {
		for (double l : data) {
			print(out, l);
			print(out, div);
		}
	}
	
	/**
	 * @param out
	 * @param div
	 * @param data
	 */
	public static void prints(PrintStream out, String div, char... data) {
		for (char l : data) {
			print(out, l);
			print(out, div);
		}
	}
	
	/**
	 * @param out
	 * @param div
	 * @param data
	 */
	public static void prints(PrintStream out, String div, boolean... data) {
		for (boolean l : data) {
			print(out, l);
			print(out, div);
		}
	}
	
	/**
	 * @param out
	 * @param div
	 * @param data
	 */
	public static void prints(PrintStream out, String div, long... data) {
		for (long l : data) {
			print(out, l);
			print(out, div);
		}
	}
	
	/**
	 * @param out
	 */
	public static void println(PrintStream out) {
		out.println();
	}

}
